<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%ns_messageText}}".
 *
 * @property integer $messageText_id
 * @property string $content
 *
 * @property NsMessage[] $nsMessages
 */
class MessageText extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%ns_messageText}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
           // [['content'], 'required'],
            [['content'], 'string', 'max' => 4000]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'messageText_id' => Yii::t('Message', 'Message Text ID'),
            'content' => Yii::t('Message', 'Content'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getNsMessages()
    {
        return $this->hasMany(NsMessage::className(), ['messageText_id' => 'messageText_id']);
    }
}
